Developing custom pages
The default web pages installed with the EMu system provide simple and immediate access to the EMu collection via the web. Presenting a consistent experience for users browsing your organization's website is important. Most organizations will want to integrate EMu's web interface with their existing site. The Web Objects provided with the system offer a web designer the control required to ensure the searching integrates with the site rather than looking like an add-on product.

The installation process for EMuWeb creates a directory in the web server document root called emuweb
client. This contains the default pages and the PHP code used to generate the Web Objects. All pages and PHP scripts under the web directory are maintained by us. Custom pages should not be created in the web directory as upgrading in the future may delete your pages. You may place your own pages anywhere else on your site.
An Example:
|
The Museum's home page. This page contains a |
|
A static page containing historic information about the Museum. |
|
A page containing a |
|
This page contains a |
|
The dinosaurs page is a page put together for a special event. This page contains a |

Making custom pages involves the following process:
- Creating a standard HTML page in conjunction with your design requirements, leaving room for the relevant web object. For example, a page designed to offer public query access to EMu may contain the organization's standard header, navigation bar and background. Room would be left for the
BasicQuery
object. - Adding the EMu web object using embedded PHP code. This is covered in the section on Web Objects.
- Setting the properties on the Web Objects to control the visual appearance, content and other behaviour.
Another approach is to take a copy of the default pages supplied with the EMuWeb system and modify the HTML as appropriate.
Note: After copying and saving the default pages to a new location, don't forget to modify the require or include paths (see Include Files for details).

In order to use the EMuWeb objects, the object's code must be included in your HTML pages. An include
(or require
) statement must be placed in the HTML prior to the use of an object. For example:
<?php
require_once('web/objects/common/PreConfiguredQueryLink.php');
$dinosaurlink = new PreConfiguredQueryLink;
$dinosaurlink->Where = "ColCollectionArea = 'dinosaur'";
...
?>
The include files are located in the web/objects
directory. Details on the files to include for each object are found in the Web Objects Reference.
The contents of the web
directory are provided and managed by us. It is important that your web developers/designers don't modify any pages or code underneath the web
directory as future upgrades of the EMu system will replace any changes. If you would like to make changes to the default pages, you should take a copy and work in a separate directory located out of the web
directory.

Web pages are connected together, or associated, with the use of hyperlinks. The hyperlinks are generated with the Anchor tag. The Anchor has an associated reference to another page. The Web Objects in the EMu system must also be associated with other pages. For example, when users click on a record in a results list, they will be directed to a display page. The path or reference to the display page is determined by a property on the results list object. Thus a record in a list on the results page has a location property within it - this property tells the Web Object exactly where to find the display page. For example, a typical path followed by the user would be as follows:
Query Page (with QueryForm object) >> Results Page (with ResultsList object) >> Detailed Display Page (with a Display object)
(EMu "Web Objects" are enclosed in the blue borders)
All objects have a set of PageReference
properties that control the association between pages in the query process. The Query object directs the user to the Results page as set on the ResultsListPage
property on the query object.
$queryform = new GalleryBasicQueryForm;
$queryform->ResultsListPage = "/mydirectory/results.php";
...
$queryform->Show();
The ResultsList
object in turn links to a Display page so when the user clicks on an entry in the table, they are taken to the detailed view. The reference to the display page is set on the ResultsList
object with the DisplayPage
property.
$resultslist = new GalleryResultsList;
$resultslist->DisplayPage = "/mydirectory/display.php";
...
$resultslist->Show();
Other properties on objects that control page references are:
$resultslist->ContactSheetPage = "...";
$contactsheet->ResultsListPage = "...";
$display->PartyDisplayPage = "...";
All page references have a default value. The default is to direct the user to the default pages supplied with the EMuWeb system.

It's important that the Web Objects placed on the pages have a similar appearance and style to the surrounding page design to ensure that the user is presented with a seamless experience while navigating through your organization's entire site.
The appearance and style of an object is controlled via properties. The sections Web Objects and Web Objects Reference cover all the properties available to the page designer. As a minimum, it's recommended that:
- Font and font colour are set to match surrounding text.
- Background and border colours are set to coordinate with surrounding content.

The default pages provided with the EMu system only display a subset of the data available in the EMu system. The Web Objects also default to a standard set of fields. Control over the fields displayed on the web are configurable using the Fields
or AdditionalFields
properties on the appropriate objects. These properties are set to PHP arrays that contain a list of fields to be displayed. Some common examples are:
- The
ResultsList
object does not contain the columns I would like. I want it to display the Catalogue Number, Species Name and Country of Origin.The columns displayed in the
ResultsList
object are set by theFields
property. The following code would produce the desired results:$resultslist = new NmnhResultsList;
$resultslist->Font = 'Times';
$resultslist->Fields = array('CatCatalogNo', 'CatSpeciesName', 'LocCountryOfOriginLocal');
$resultslist->Show();
- I would like to display the Acquisition Method in the detailed view. The default set of fields in the display object does not list this field. I would like to add the Acquisition Method field to my display page.
The
AdditionalFields
property on the display object will quickly allow you to add extra information to the detailed display view. The additional fields will be added to the bottom of the display object. The following code will add the Acquisition Method field:$display = new GalleryStandardDisplay;
$display->Font = 'Arial';
$display->AdditionalFields = array('AccAccessionLotRef->eaccessionlots->AcqAcquisitionMethod');
$display->Show();